package animator.phantom.gui.preview;

/*
    Copyright Janne Liljeblad 2006,2007,2008

    This file is part of Phantom2D.

    Phantom2D is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Phantom2D is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Phantom2D.  If not, see <http://www.gnu.org/licenses/>.
*/

import animator.phantom.gui.GUIResources;
import animator.phantom.controller.PreviewController;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;

//--- This needs to be removed
public class ScreenModeButtons
{
	public JToggleButton viewFlow = new JToggleButton(  GUIResources.getIcon(GUIResources.viewFlow ) );
	public JToggleButton viewTarget = new JToggleButton(  GUIResources.getIcon(GUIResources.viewTarget ) );
	//public JToggleButton viewIOP = new JToggleButton(  GUIResources.getIcon( GUIResources.viewIOP ) );

	public JToggleButton viewColor = new JToggleButton(  GUIResources.getIcon( GUIResources.viewImage ) );
	public JToggleButton viewAlpha = new JToggleButton(  GUIResources.getIcon( GUIResources.viewAlpha ) );

	public ButtonGroup modes;
	public ButtonGroup colorAlpha;

	public ScreenModeButtons( ActionListener listener )
	{
		GUIResources.prepareMediumButton( viewColor, listener, "View image" );
		GUIResources.prepareMediumButton( viewAlpha, listener, "View alpha" );
		GUIResources.prepareMediumButton( viewTarget, listener, "View flow at target" );
		GUIResources.prepareMediumButton( viewFlow, listener, "View flow" );
		//GUIResources.prepareMediumButton( viewIOP, listener, "View target source program" );

		viewColor.setSelectedIcon(  GUIResources.getIcon( GUIResources.viewImagePressed ) );
		viewAlpha.setSelectedIcon(  GUIResources.getIcon( GUIResources.viewAlphaPressed ) );
		viewTarget.setSelectedIcon(  GUIResources.getIcon(GUIResources.viewTargetPressed ) );
	//	viewIOP.setSelectedIcon(  GUIResources.getIcon(GUIResources.viewIOPPressed ) );
		viewFlow.setSelectedIcon( GUIResources.getIcon( GUIResources.viewFlowPressed ) );

		modes = new ButtonGroup();
		modes.add( viewFlow );
		modes.add( viewTarget );
	//	modes.add( viewIOP );
		modes.setSelected( viewFlow.getModel(), true );

		colorAlpha = new ButtonGroup();
		colorAlpha.add( viewColor );
		colorAlpha.add( viewAlpha );
		colorAlpha.setSelected( viewColor.getModel(), true );
	}

	public void feedButtons( JPanel target )
	{	
	//	target.add( viewFlow );
	//	target.add( viewTarget );
	//	target.add( viewIOP );
		target.add( Box.createRigidArea( new Dimension(4,0) ));
		target.add( viewColor );
		target.add( viewAlpha );
	}

}//end class